/**
 * @author: Miss.杨
 * @date: 2025年3月08日 22:40:30
 * @description: 
 */
package com.sheepone.monitor.audit.core.enums;

/**
 * @author: Miss.杨
 * @date: 2025年3月08日 22:40:30
 * @description:
 */
public enum ActionEnum {
    CREATE("0", "新增"),
    UPDATE("1", "更新"),
    DELETE("2", "删除"),
    QUERY("3", "查询"),
    OTHER("4", "未知"),
    STAR("5", "收藏"),
    UNSTAR("6", "取消收藏"),
    MOVE("7", "移动"),
    COPY("8", "复制"),
    RENAME("9", "重命名"),
    DOWNLOAD("10", "下载"),
    UPLOAD("11", "上传"),
    RECYCLE("12", "回收"),
    RECOVER("13", "恢复"),
    DELETE_FOREVER("14", "永久删除"),
    RESTORE("15", "还原"),
    EXPORT("16", "导出"),
    IMPORT("17", "导入"),
    RESTART("18","重启"),
    LOGIN("19","登录"),
    LOGOUT("20","登出"),
    ;

    private final String action;
    private final String name;

    private ActionEnum(String action, String name) {
        this.action = action;
        this.name = name;
    }

    public String getAction() {
        return action;
    }

    public String getName() {
        return name;
    }

    public static ActionEnum getEnum(String action) {
        for (ActionEnum actionEnum : ActionEnum.values()) {
            if (actionEnum.getAction().equals(action)) {
                return actionEnum;
            }
        }
        return OTHER;
    }
}
